import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
import dayjs from "dayjs";
import { format } from 'path';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '手机号',
    align: "center",
    dataIndex: 'phonenumber'
  },
  {
    title: '订单时间',
    align: "center",
    dataIndex: 'processtime',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      if(text) {
        return getWeekMonthQuarterYear(text)['month'];
      } else {
        return text;
      }
    },
  },
  {
    title: '渠道分发号',
    align: "center",
    dataIndex: 'cpid'
  },
  {
    title: '状态',
    align: "center",
    dataIndex: 'status_dictText'
  },
  {
    title: '业务渠道号',
    align: "center",
    dataIndex: 'chid'
  },
  {
    title: '业务代码',
    align: "center",
    dataIndex: 'serviceid'
  },
  {
    title: '金额(分)',
    align: "center",
    dataIndex: 'fee'
  },
  {
    title: '业务名称',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '省份',
    align: "center",
    dataIndex: 'provinceid'
  },
  {
    title: '创建时间',
    align: "center",
    dataIndex: 'createtime'
  },
];

// 高级查询数据
export const superQuerySchema = {
  phonenumber: {title: '手机号',order: 0,view: 'text', type: 'string',},
  processtime: {title: '订单时间(月)',order: 1,view: 'date',type: 'string',},
  cpid: {title: '渠道分发号',order: 2,view: 'text', type: 'string',},
  status: {title: '状态',order: 3,view: 'list', type: 'string',dictCode: 'success_fail',},
  chid: {title: '业务渠道号',order: 4,view: 'text', type: 'string',},
  serviceid: {title: '业务代码',order: 5,view: 'text', type: 'string',},
  fee: {title: '金额(分)',order: 6,view: 'text', type: 'string',},
  name: {title: '业务名称',order: 7,view: 'text', type: 'string',},
  provinceid: {title: '省份',order: 8,view: 'text', type: 'string',},
  createtime: {title: '创建时间',order: 9,view: 'datetime', type: 'string',},
};
